//
//  TestWindow.m
//  sandbox
//
//  Created by 杨岑 on 1/5/15.
//  Copyright (c) 2015 杨岑. All rights reserved.
//

#import "TestWindow.h"

@implementation TestWindow

- (BOOL)canBecomeKeyWindow
{
    return YES;
}

- (id)initWithContentRect:(NSRect)contentRect
                styleMask:(NSWindowStyleMask)aStyle
                  backing:(NSBackingStoreType)bufferingType
                    defer:(BOOL)flag {
    
    // Using NSBorderlessWindowMask results in a window without a title bar.
    self = [super initWithContentRect:contentRect styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
    if (self != nil) {
        self.movableByWindowBackground = YES;
        // Start with no transparency for all drawing into the window
        [self setAlphaValue:1.0];
        // Turn off opacity so that the parts of the window that are not drawn into are transparent.
        [self setOpaque:NO];
    }
    return self;
}


- (void)awakeFromNib
{
    /*
        self.styleMask = NSBorderlessWindowMask;
        self.movableByWindowBackground = YES;
        self.level = NSNormalWindowLevel;
        self.opaque = NO;
        //self.alphaValue = .7;
        //self.backgroundColor = [NSColor clearColor];
    */
}

@end
